//
//  MyTabbarController.m
//  MobileShoppingMall
//
//  Created by 冯传昌 on 2021/4/13.
//  Copyright © 2021 冯传昌. All rights reserved.
//

#import "MyTabbarController.h"

#import "MainPageViewController.h"
#import "PreferredViewController.h"
#import "GuideMallViewController.h"
#import "ShoppingCartViewController.h"
#import "PersonCenterViewController.h"

@interface MyTabbarController ()

@end

@implementation MyTabbarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
//    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(136, 136, 136),NSFontAttributeName:FontSet(11)} forState:normal];
//    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(37, 130, 255),NSFontAttributeName:FontSet(11)} forState:UIControlStateSelected];
    
    [self initSubVC];
}

-(void)initSubVC{
    
    MainPageViewController * mainPageVC = [[MainPageViewController alloc] init];
    UINavigationController * mainPageNav = [[UINavigationController alloc] initWithRootViewController:mainPageVC];
    mainPageNav.tabBarItem.title = @"TB商城";
    mainPageNav.tabBarItem.image = LoadImage(@"TB商城_unSelect");
    mainPageNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"TB商城_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [self addChildViewController:mainPageNav];
    
    PreferredViewController * preferredVC = [[PreferredViewController alloc]init];
    UINavigationController * goodsNav = [[UINavigationController alloc] initWithRootViewController:preferredVC];
    goodsNav.tabBarItem.title = @"优选商城";
    goodsNav.tabBarItem.image = LoadImage(@"优选商城_unSelect");
    goodsNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"优选商城_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [self addChildViewController:goodsNav];
    
    GuideMallViewController * guideMallVC = [[GuideMallViewController alloc] init];
    UINavigationController * mallNav = [[UINavigationController alloc] initWithRootViewController:guideMallVC];
    mallNav.tabBarItem.title = @"指南商城";
    mallNav.tabBarItem.image = LoadImage(@"指南商城_unSelect");
    mallNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"指南商城_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [self addChildViewController:mallNav];
    
    ShoppingCartViewController * shoppingCarVC = [[ShoppingCartViewController alloc] init];
    UINavigationController * shoppingCarNav = [[UINavigationController alloc] initWithRootViewController:shoppingCarVC];
    shoppingCarNav.tabBarItem.title = @"购物车";
    shoppingCarNav.tabBarItem.image = LoadImage(@"购物车_unSelect");
    shoppingCarNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"购物车_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [self addChildViewController:shoppingCarNav];
    
    PersonCenterViewController * personVC = [[PersonCenterViewController alloc] init];
    UINavigationController * personNav = [[UINavigationController alloc] initWithRootViewController:personVC];
    personNav.tabBarItem.title = @"个人中心";
    personNav.tabBarItem.image = LoadImage(@"个人中心_unSelect");
    personNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"个人中心_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [self addChildViewController:personNav];
}





@end





